//
//  BaseNextButton.m
//  WeiDianGuanJia
//
//  Created by 谢英泽 on 2017/4/8.
//  Copyright © 2017年 谢英泽. All rights reserved.
//

#import "BaseNextButton.h"
#import "AppHeader.h"

@implementation BaseNextButton

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.layer.cornerRadius = 5.f;
        self.titleLabel.font = kFONT_mainFont(16.f);
    }
    return self;
}

- (void)setAvailable:(BOOL)available
{
    _available = available;
    if (available) {
        self.backgroundColor = KCOLOR_mainColor;
        self.userInteractionEnabled = YES;
    }else{
        self.backgroundColor = [KCOLOR_mainColor colorWithAlphaComponent:0.5];
        self.userInteractionEnabled = NO;
    }
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    [self setTitle:title forState:UIControlStateNormal];
}

- (void)setImageName:(NSString *)imageName
{
    _imageName = imageName;
    [self setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
}

@end
